#include "precompile.h"

#include "LineEventHandler.h"
#include "command/arg/SplineItemArgument.h"

LineEventHandler::LineEventHandler()
{
}

LineEventHandler::~LineEventHandler()
{
}

Tracker* LineEventHandler::BeginTrack()
{
	return new LineTracker();
}

bool LineEventHandler::EndTrack(SystemEventArgs* e,const Point& begin,const Point& end)
{
	Point rbegin = interaction->CalcRelativePoint(begin);
	Point rend = interaction->CalcRelativePoint(end);

	SplineItemArgument arg(rbegin,
												rend,
												lineSplineItemRegion);
	GetApplication()->GetController()->ExecuteCommand(Commands::CreateSplineItem,&arg);
	return true;
}